package com.zch.work.controller;

import com.zch.domain.Result;
import com.zch.entity.TbProcess;
import com.zch.work.service.TbProcessService;
import com.zch.work.vo.DeletedVo;
import com.zch.work.vo.ProcessVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 28763 工序维护
 * @version 1.0
 * @description: TODO
 * @date 2023/10/30 20:02
 */
@RestController
@RequestMapping("/process")
public class ProcessController {

    @Autowired
    TbProcessService tbProcessService;

    /**
    * @description: TODO 模糊查询+分页
    * @author 王志赛
    * @date 2023/10/30 21:10
    * @version 1.0
    */
     @PostMapping("/select")
    public Result select(@RequestBody ProcessVo processVo){
         return tbProcessService.selectAll(processVo);
     }

     /**
     * @description: 逻辑删除
     * @author 王志赛
     * @date 2023/10/30 21:10
     * @version 1.0
     */
     @PostMapping("/deletedById")
    public Result deleted(@RequestBody DeletedVo deletedVo){
         return tbProcessService.deleted(deletedVo);
     }

     /**
     * @description: TODO 修改
     * @author 王志赛
     * @date 2023/10/30 21:26
     * @version 1.0
     */
     @PostMapping("/updateByID")
    public Result updateByID(@RequestBody TbProcess tbProcess){
         return tbProcessService.updateByID(tbProcess);
     }

     /**
     * @description: TODO 添加
     * @author 王志赛
     * @date 2023/10/30 21:27
     * @version 1.0
     */
     @PostMapping("/save")
    public Result save(@RequestBody TbProcess tbProcess){
         return tbProcessService.addProcess(tbProcess);
     }

}
